﻿// Copyrights (c) 2017 GlassGrass

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GlassGrass.Unity.GuiFramework.Extensions
	{
	/// <summary> GuiElement extension methods. </summary>
	public static class GuiElementExtensions
		{

		/// <summary> Add element to container. </summary>
		/// <typeparam name="T"></typeparam>
		/// <param name="element"></param>
		/// <param name="container"></param>
		/// <returns></returns>
		/// <remarks> This method provides easy adding way. </remarks>
		public static T AddTo<T>(this T element, IContainer container)
			where T: GuiElement
			{
			container.Children.Add(element);
			return element;
			}

		}
	}
